{include file="Public:header" /}
<div class="bar bar-nav">
    <h1 class="title">专家详情</h1>
    <i class="icon icon-left" onclick="window.history.go(-1);"></i>
</div>

<nav class="bar bar-tab">
    <a class="tab-item active" href="{:U('Index/index')}">
        <span class="icon icon-home"></span>
        <span class="tab-label">首页</span>
    </a>
    <!--			<a class="tab-item" onclick="zixun();">
                                    <span class="icon iconfont icon-phone"></span>
                                    <span class="tab-label">咨询</span>
                            </a>-->
    <a class="tab-item open-indicator " href="{:U('Users/index')}">
        <span class="icon iconfont icon-account"></span>
        <span class="tab-label">我的</span>
    </a>
    {if condition="$apply_count"}
    <a class="tab-item" href="{:U('Apply/expert_join')}">
        <span class="icon iconfont icon-account"></span>
        <span class="tab-label">我要加入</span>
    </a>
    {/if}
</nav>

<div class="content">
    <div class="hotel_top clearfix expert_page">
        <div class="hotel_top_img">
            <img src="{$apply_one['headimgurl']}">
        </div>
        <div class="hotel_top_text">
            <h3>{$apply_one['user_name']}&nbsp;&nbsp;<strong>
                    {switch name="apply_one['type']"}
                    {case value="1"}军事专家{/case}
                    {case value="2"}国防专家{/case}
                    {case value="3"}医学专家{/case}
                    {/switch}
                </strong></h3>
            <p class="text_line3">{$apply_one['signature']}<span>展开更多</span></p>
            <p>
                <!--<span>好评：<font>{$apply_one['praise_number']}</font></span>-->
                <span>访问：<font>{$apply_one['visit_number']}</font></span>
            </p>
        </div>
    </div>

    <div class="expert_page_list clearfix" id="expert_page_list">
        <div class="bd" style='height: 3rem;overflow: hidden;overflow-x: scroll;'>
            <ul style="height: 59px;width: 1100px;">
                <li class="col-33" style='width: 9%;margin-right: 1%;float: left;height: 100%;'><a target="_back" href="{$apply_one['video_url']}"><img style='width:100%;height: 100%;' src="__PUBLIC__/Home/images/video.jpg" ></a></li>
                {if condition="$apply_one['more_img_list']"}
                {volist name="apply_one['more_img_list']" id="mm"}
                <li class="col-33" style='width: 8%;margin-right: 1%;float: left;height: 100%;'><a href="__ROOT__{$mm}"><img style='width:100%;height: 100%;' src="{$mm}" ></a></li>
                {/volist}
                {/if}

            </ul>
        </div>
        {if condition="$yuyue_show"}
        <a class="button button-fill" style="margin:1rem auto;height:1.8rem;line-height:1.8rem;background: #ccc">立即预约</a>
        {else/}
        <a class="button button-fill" onclick="yuyue()" style="margin:1rem auto;height:1.8rem;line-height:1.8rem;">立即预约</a>
        {/if}    
    </div>

    <div class="buttons-tab mechan-page-tab" style="margin-top:0px;">
        <a href="#tab1" class="tab-link active button">发布的活动</a>
        <a href="#tab2" class="tab-link button">评论</a>
        <a href="#tab3" class="tab-link button">专家介绍</a>
    </div>
    <div class="content-block row in_tab_list">
        <div class="tabs">
            <div id="tab1" class="tab in_hot_box activity_1 active">
                <div id="activity_apply">
                    {foreach name="activity" item="activity" key="aa"}
                    <div class="card demo-card-header-pic">
                        <a href="{:U('ActivityDetail/index',array('activity_id'=>$activity['id'],'city'=>$activity['city']))}">
                            <div valign="bottom" class="card-header color-white no-border no-padding">
                                <img class='card-cover' src="{$activity['activity_img']}" alt="">
                            </div>
                            <div class="card-content">
                                <div class="card-content-inner">
                                    <p class="hot_list_title">{$activity['activity_name']}</p>
                                    <p class="color-gray">时间 {$activity['start_time']|date="Y/m/d",###}~{$activity['end_time']|date="Y/m/d",###}</p>
                                    <p class="color-gray"><span>{$activity['area']}</span><span>{$activity['signup_number']}人已报名</span><span>￥{$activity['price']}</span></p>
                                </div>
                            </div>
                        </a>
                    </div>
                    {/foreach}
                </div>
                {if condition="$activity_show"}
                <div class="infinite-scroll-preloader" id="activity_quan" style="display:none;">
                    <div class="preloader"></div>
                </div>
                <p onclick="ajax_activity_submit();" class="activity_more" id="load_more"><span class="icon icon-down"></span> 点击加载更多...</p>
                {else/}
                <p id="load_more"> 暂无数据！</p>
                {/if}

            </div>
            <div id="tab2" class="tab in_hot_box activity_1">

                <div class="row discuss expert_discuss">
                    <div class="col-100">
                        <div class="content-padded">
                            <div class="sign_title content-block-title">评论（{$count}）</div>
                            <div class="list-block media-list">
                                <ul>
                                    {foreach name="comment" item="comment" key="cc"}
                                    <li class="item-content">
                                        <div class="item-media" style='min-width: 60px;'>
                                            <img src="{$comment['headimgurl']}">
                                        </div>
                                        <div class="item-inner">
                                            <div class="item-title-row">
                                                <div class="item-title">{$comment['user_name']}<span class="pull-right">{$comment['add_time']|date='Y-m-d',###}</span></div>
                                            </div>
                                            <div class="item-subtitle">{$comment['content']}</div>
                                        </div>
                                    </li>
                                    {/foreach}
                                </ul>
                                {if condition="$comment_show"}
                                <div class="discuss_move text-center"><a href="{:U('Apply/discuss_list',array('id'=>$id))}">更多评论</a></div>
                                {/if}
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div id="tab3" class="tab in_hot_box activity_1">
                {if condition="$apply_one['introduce'] neq ''"}
                <div class="row discuss expert_discuss"  style="margin-bottom: 10px;">
                    <div class="col-100">
                        <div class="content-padded" style='font-size: 14px'>
                            {$apply_one['introduce']}
                        </div>
                    </div>
                </div>
                {else/}
                <p id="load_more"> 暂无简介！</p>
                {/if}
            </div>
        </div>
    </div>
</div>

<div class="activity_from_bg" style="display: none;"></div>
<div class="activity_from" style="display: none;">

    <form id="submitForm" onsubmit="return false;">
        <span class="close js-bm"><i class="iconfont icon-add"></i></span>
        <div class="list-block">
            <div class="item-title text-center">填写预约</div>
            <ul>
                <!-- Text inputs -->
                <li>
                    <div class="item-content">
                        <div class="item-media"><i class="icon icon-form-name"></i></div>
                        <div class="item-inner">
                            <div class="item-title label">姓名</div>
                            <div class="item-input">
                                <input type="text" placeholder="张三" name='username'>
                            </div>
                        </div>
                    </div>
                </li>
                <li>
                    <div class="item-content">
                        <div class="item-media"><i class="icon icon-form-name"></i></div>
                        <div class="item-inner">
                            <div class="item-title label">手机</div>
                            <div class="item-input">
                                <input type="tel" placeholder="13456789101" name="phone">
                            </div>
                        </div>
                    </div>
                </li>
                <li>
                    <div class="item-content">
                        <div class="item-media"><i class="icon icon-form-name"></i></div>
                        <div class="item-inner">
                            <div class="item-title label">地址</div>
                            <div class="item-input">
                                <input type="text" name="address"  placeholder='天河客运站'>
                            </div>
                        </div>
                    </div>
                </li>
                <li>
                    <div class="item-content">
                        <div class="item-media"><i class="icon icon-form-name"></i></div>
                        <div class="item-inner">
                            <div class="item-title label">预约时间</div>
                            <div class="item-input">
                                <input type="tel" id="expert_time" name='select_time' placeholder='请选择时间'>
                            </div>
                        </div>
                    </div>
                </li>
            </ul>
        </div>
        <div class="content-block">
            <div class="row" style='margin-left: 0;'>
                <input name='pay' type="hidden" value='21'>
                <input name='id' type="hidden" value='{$id}'>
                <!--<div class="col-50"><span>合计：<font class="button-danger">￥21.00</font></span></div>-->
                <a href="javascript:void(0);" id="submitbutton" class="button button-big button-fill button-danger">提交</a>
            </div>
        </div>
    </form>
</div>

{include file="Public:footer" /}
<script src="__PUBLIC__/Admin/plugins/layer/layer.js"></script>
<script>
			
                        Zepto("#expert_time").picker({
                          toolbarTemplate: '<header class="bar bar-nav">\
                          <button class="button button-link pull-right close-picker">确定</button>\
                          <h1 class="title">要预约的时间</h1>\
                          </header>',
                          cols: [
                            {
                              textAlign: 'center',
//			      values: ['星期一', '星期二', '星期三', '星期四', '星期五', '星期六', '星期日',]
                                values: [{$make_one['select_time']}]
                            }
                          ]
                        });
			
                        function yuyue(){
                                $(".activity_from").slideToggle();
                                $(".activity_from_bg").fadeToggle();
                        }
                        var swiper = new Swiper('.swiper-container', {
                                pagination: '.swiper-pagination',
                                paginationClickable: true
                        });
			
                        jQuery(document).ready(function(){
                                $(".text_line3 span").on("click",function(){
                                        $(this).parent().toggleClass("block");
					
                                        if ($(this).text() =='收缩') {
                                                $(this).text("展开更多")
                                        } else{
                                        $(this).text("收缩")
                                        }
                                })
                        })
                        
    $('#submitbutton').click(function(){
        $.ajax({
              url:"{:U('Apply/expert_page_yuyue')}",
            dataType: 'json',
            type:'post',
            data:$('#submitForm').serialize(),
            success:function(data){
                console.log(data);
                if(data.status == 1){
                    Zepto.confirm(data.message, '温馨提示',function(){
                        window.location.href="{:U('Apply/expert_discuss')}";
                    });
                    return false;
//                         layer.confirm(data.message,{btn:['确定'], icon:1, closeBtn: 2 },function(index){
//                            window.location.href="{:U('Apply/expert_discuss')}";
//                        });
                    
                }else if(data.status == 2){
//                    layer.msg(data.message,{time:2000,icon:2});
                    Zepto.toast(data.message, 2000, 'success top');
                    return false;
                }
            }
        });
    });
    
     var  page_stay = 1;
 /*** ajax 提交表单 查询国防列表结果*/  
 function ajax_activity_submit()
 {	 	 	 
                $("#activity_quan").show();
                page_stay += 1;
                $.ajax({
                        type : "GET",
                        //url:"/index.php?m=Mobile&c=User&a=collect_list&is_ajax=1&p="+page,//+tab,			
                        url:"/Apply/ajax_expert_page/is_ajax/1/p/"+page_stay,//+tab,
//			data : $('#filter_form').serialize(),// 你的formid 搜索表单 序列化提交
                        success: function(data)
                        {
                                $("#activity_quan").hide();
                                if($.trim(data) == ''){
                                        $('.activity_more').hide();
                                }else{
                                    $("#activity_apply").append(data);
                                }
                        }
                }); 
 } 
                      
    //咨询
    function zixun(){
        Zepto.confirm("蔡总：13456789123<br>李总：13456789456", '咨询电话','success top');
        return false;
    };
</script>

	

</html>